<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"
	trimDirectiveWhitespaces="true"%>
<%@page import="java.util.Date"%>
<%@ include file="../admin.inc.jsp"%>

<div class="pageHeader">
	<form method="post" id="pagerForm" action="${webContextPath}/admin/userAuthInfo/list" onsubmit="return navTabSearch(this)">
	<input type="hidden" name="pageNum" id="pageNum" value="${pageInfo.pageNum}" />
	<input type="hidden" name="numPerPage" id="numPerPage" value="${pageInfo.numPerPage}"/>
	<div class="searchBar">
		<ul class="searchContent">
			<li>
				<label>用户ID：</label>
				<input id="userId" type="text" name="userId" value="${userId}" class="textInput">
			</li>
			
			<li>
				<label>状态：</label>
				<select id = "approveStatus" name="approveStatus" >
					<option value="" ></option>
					<option value="01"  ${approveStatus=="01"?"selected":""}>待审核</option>
					<option value="02"  ${approveStatus=="02"?"selected":""}>驳回</option>
					<option value="03"  ${approveStatus=="03"?"selected":""}>审核通过</option>
				</select>
			</li>
		</ul>
		<ul class="searchContent">	
			<li>
				<label>申请时间：</label>
				<input id="applyBeginTime"  class="Wdate" type="text"  name="applyBeginTime" 
				value="<fmt:formatDate value='${applyBeginTime}' pattern="yyyy-MM-dd HH:mm:ss" />"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="true">
				<a class="inputDateButton" style="float:right; "  href="javascript:;">选择</a>
			</li>
			
			<li>
				<label>        -</label>	
				<input id="applyEndTime"  class="Wdate" type="text"  name="applyEndTime" 
				value="<fmt:formatDate value='${applyEndTime}' pattern="yyyy-MM-dd HH:mm:ss" />"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly="true">
				<a class="inputDateButton" style="float:right; "  href="javascript:;">选择</a>
			</li>
		</ul>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent j-resizeGrid">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a iconClass="page_white_text" href="${webContextPath}/admin/userAuthInfo/detail?id={userAuthInfoId}" target="navTab" mask="true"
               width="530" height="500" title="查看详情" rel="userAuthInfoDetail">
               <span>查看详情</span>
            </a></li>
            <li><a iconClass="page_white_text" href="${webContextPath}/admin/userAuthInfo/editInfo?id={userAuthInfoId}" target="navTab" mask="true"
               width="530" height="500" title="修改" rel="userAuthInfoDetail">
               <span>修改</span>
            </a></li>
            <li><a iconClass="page_excel"  onclick="exportExcel()" target="_self" title="确实要导出这些记录吗?" ><span>导出EXCEL</span></a></li>
		</ul>
	</div>
	<div class="grid" layouth="90" style="width: 1149px; overflow: auto;">
	<table class="table" width="100%">
		<thead>
			<tr>
				<th width="40">ID</th>
				<th width="70">用户ID</th>
				<th width="70">名称</th>
				<!-- <th width="70">用户昵称</th>
				<th width="70">用户真实姓名</th> -->
				<th width="70">申请时间</th>
				<th width="70">申请类型</th>
				<th width="70">地址</th>
				<th width="50">状态</th>
			</tr>
		</thead>
		<tbody style="text-align:center">
			<c:forEach var="item" items="${list}">
				<tr target="userAuthInfoId" rel="${item.id}" style="">
					<td>${item.id}</td>
					<td>${item.userId}</td>
					<td>${item.name}</td>
 					<%-- <td>${item.nickName}</td>
					<td>${item.realName}</td> --%>
					<td><fmt:formatDate value='${item.applyTime}' pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td>${item.authType==1?"企业用户":"个人用户"}</td>
					<td>${item.addr}</td>
					
					<td>					
					<select disabled="disabled" style="width:100%;">
						<option value="01"  ${item.approveStatus=="01"?"selected":""}>待审核</option>
						<option value="02"  ${item.approveStatus=="02"?"selected":""}>驳回</option>
						<option value="03"  ${item.approveStatus=="03"?"selected":""}>审核通过</option>
					</select>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	</div>
	<div class="panelBar" style="bottom:0px">
		<div class="pages">			
			<span>共${size}条</span>
		</div>
		<div class="pagination" targettype="navTab" totalcount="${size}" 
		numperpage="${pageInfo.numPerPage}" pagenumshown="10" currentpage="${pageInfo.pageNum}">
		</div>
	</div>
</div>
<script language="JavaScript"> 
  function exportExcel(){
	  var ext = '';
	  var userId = $('#userId').val();
	  if(userId!=''){
		  ext = '?userId='+userId;
	  }
	  var approveStatus = $('#approveStatus').val();
	  if(approveStatus!=''){
		  if(ext!=''){
			  ext = ext + '&approveStatus='+approveStatus;
		  } else {
			  ext = '?approveStatus='+approveStatus;
		  }
	  }
	  var applyBeginTime = $('#applyBeginTime').val();
	  if(applyBeginTime!=''){
		  if(ext!=''){
			  ext = ext + '&applyBeginTime='+applyBeginTime;
		  } else {
			  ext = '?applyBeginTime='+applyBeginTime;
		  }
	  }
	  var applyEndTime = $('#applyEndTime').val();
	  if(applyEndTime!=''){
		  if(ext!=''){
			  ext = ext + '&applyEndTime='+applyEndTime;
		  } else {
			  ext = '?applyEndTime='+applyEndTime;
		  }
	  }
	  var url = '${webContextPath}/admin/userAuthInfo/exportExcel'+ext;
	  window.location.href=url;
  }
</script>